/*
 * globals.h
 *
 *  Created on: Apr 5, 2013
 *      Author: root
 */

#ifndef GLOBALS_H_
#define GLOBALS_H_

#include <dirent.h>
#include <stdio.h>

#define MAXDATA 1024
#define ARGUMENT_DELIMITER " "
#define MAX_COMMAND_LENGHT 100

typedef struct {
	char *pwd;
	int	currentStatus;
	FILE *ofile;
	DIR *odir;
	struct dirent *ent;
} connectionInfo;

#define FTP_RETURN_OK "200"
#define FTP_RETURN_FILE_END "201"

// Error statuses
#define FTP_RETURN_INVALID_DIRNAME "400"
#define FTP_RETURN_INVALID_FILENAME "401"
#define FTP_RETURN_ACCESS_DENIED "402"
#define FTP_RETURN_CANNOT_CREATE_FILE "403"
#define FTP_RETURN_CANNOT_READ_FILE "404"
#define FTP_RETURN_COMMAND_NOT_FOUND "405"

// ServerFault statuses
#define FTP_RETURN_SERVER_ERROR "500"


#define FTP_STATUS_WAITING_FOR_COMMEND 1
#define FTP_STATUS_WAITING_FOR_CONTENT 2
#define FTP_STATUS_SENDING_CONTENT 3

#define FTP_COMMAND_LS "1"
#define FTP_COMMAND_PUT "2"
#define FTP_COMMAND_GET "3"
#define FTP_COMMAND_LCD "4"
#define FTP_COMMAND_CD "5"


#endif /* GLOBALS_H_ */
